import { Component } from 'react'
import { View, Text, Button, Image } from '@tarojs/components'
import './foodlist.less'
import AddCut from './addcut'
export default class FoodList extends Component {
    constructor(){
        super(...arguments)
        this.state={}
    }
  render () {
    let {selectCata,currentList}=this.props;
    return (
      <View className='foodlist'>
        <Text>{selectCata?selectCata.name:""}</Text>
        <View className='foodlist_forlist'>
          {
            currentList.map((item,index)=>{
              return (<View key={item.id} className='foodlist_item'>
                <Image className='image' src={item.img==2?require("../../images/2.png"):require("../../images/1.png")}></Image>
                <View className='foodlist_item_info'>
                  <Text className='title'>{item.title}</Text>
                  <Text className='sole'>月售:{item.sole}</Text>
                  <Text className='price'>¥{item.price}</Text>
                  <AddCut food={item}></AddCut>
                </View>
              </View>)
            })
          }
        </View>
        </View>
    )
  }
}
